package com.dingding.service.activity.service;

import java.math.BigDecimal;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import com.dingding.facde.activity.dto.AttendActivityDTO;
import com.dingding.facde.activity.service.IUserAttendActivityService;
import com.dingding.service.activity.core.biz.IntegralActivityService;

/**
 * 
 * @ClassName: IPreferentialActivityService 
 * @Description: 用户参加活动服务接口
 * @author CHEHAUNBO 
 * @date 2016年4月1日 上午10:50:55
 * 
 */
@Component("userAttendActivityService")
public class UserAttendActivityServiceImpl implements IUserAttendActivityService {
	private static final Logger log = Logger.getLogger(UserAttendActivityServiceImpl.class);
	@Resource(name = "integralActivityService")
	private IntegralActivityService integralActivityService;

	/**
	 * 
	 * @Title: userAttendActivity 
	 * @Description:用户参加活动
	 * 包括：赠送优惠券、赠送积分。。。
	 * @return boolean  true  成功  false 失败
	 * @author CHEHAUNBO
	 * 
	 */
	@Override
	public BigDecimal userAttendActivity(AttendActivityDTO attendActivityDTO) {
		log.info("自动取消，进入用户参加活动");
		return integralActivityService.attendAvtivity(attendActivityDTO);
	}

	/**
	 * @Title: resetInvalidActivity
	 * @Description: 重置无效积分优惠券活动
	 * @author yuHaiQing
	 * @return boolean true:重置成功   false:重置失败
	 */
	@Override
	public boolean resetInvalidIntegralActivity() {
		
		return integralActivityService.resetInvalidActivity();
	}

	/**
	 * @Title: resetPreferentialActivity
	 * @Description: 重置无效的优惠活动
	 * @author yuHaiQing
	 * @return boolean true:重置成功   false:重置失败
	 */
	@Override
	public boolean resetPreferentialActivity() {
		
		return integralActivityService.resetPreferentialActivity();
	}

	/**
	 * @Title: resetActivityLimitNumber
	 * @Description: 重置活动的限制次数（如果该活动参数次数按每天参与次数的话）
	 * @author yuHaiQing
	 * @return boolean true:重置成功  false:重置失败
	 */
	@Override
	public boolean resetActivityLimitNumber() {
		
		return integralActivityService.resetActivityLimitNumber();
	}

}
